/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.velocityme.session;

import com.velocityme.entity.Activity;
import com.velocityme.entity.ChangeDelta;
import com.velocityme.entity.Task;
import com.velocityme.entity.Transition;
import java.io.File;
import java.io.InputStream;
import java.util.Date;
import java.util.List;
import java.util.Set;
import javax.ejb.Local;

/**
 *
 * @author rcrida
 */
@Local
public interface TaskLocal {

    boolean isTaskActive(KeyLocal key, Activity activity);

    Set<Transition> getLegalTransitions(KeyLocal key, Long activityId);

    Date getTaskLastStateChangeTime(KeyLocal key, Long activityId);

    void recursiveUpdateTimes(KeyLocal key, Long taskId);

    void createDependency(KeyLocal key, Long dependencyTaskId, Long dependantTaskId);

    boolean isValidDependencyPair(KeyLocal key, Task dependencyTask, Task dependantTask);

    void removeDependency(KeyLocal key, Long dependencyTaskId, Long dependantTaskId);

    void logCreate(Task task, ChangeDelta changeDelta, boolean interested);

    void logEdit(Task task, Task current, ChangeDelta changeDelta);

    void enableInterestedState(KeyLocal key, Task task);

    List<Task> getDependencyTasks(KeyLocal key, Task task);

    List<Task> getDependantTasks(KeyLocal key, Task task);

    void reassignResponsibility(KeyLocal key, Long taskId, Long[] contactableIds, String message, File file, String contentType, InputStream stream);

    void toggleInterested(KeyLocal key, Long taskId);
    
}
